import {Component} from '@angular/core';
import {GnDatetimeUtils, GnTable} from "geminis-ng";
import {GnTableColumn} from "geminis-ng/data/table.component";
import {StopProcessComponent} from "../stop/stop-process.component";
import {HistoryTaskComponent} from "../task/history-task.component";

@Component({
  selector: 'gn-workflow-manager-history-process',
  templateUrl: './history-process.component.html'
})
export class HistoryProcessComponent extends GnTable {

  columns: GnTableColumn[] = [
    {label: '实例号', field: 'id'},
    {label: '流程编号', field: 'processDefinitionKey'},
    {label: '流程名称', field: 'processDefinitionName'},
    {label: '业务编号', field: 'businessKey'},
    {label: '发起用户', field: 'startUserId'},
    {label: '开始时间', field: 'startTime', formatter: (row: any) => GnDatetimeUtils.format(row.startTime, 'yyyy-MM-dd HH:mm:ss')},
    {label: '结束时间', field: 'endTime', formatter: (row: any) => GnDatetimeUtils.format(row.endTime, 'yyyy-MM-dd HH:mm:ss')}
  ];

  typeStop = StopProcessComponent;
  typeTask = HistoryTaskComponent;

}

